package com.fengmi.user.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fengmi.entity.sso.MallAddress;
import com.fengmi.entity.sso.SysUser;
import com.fengmi.interceptor.UserInfoInterceptor;
import com.fengmi.user.mapper.MallAddressMapper;
import com.fengmi.user.service.IMallAddressService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 小马
 * @since 2021-10-23
 */
@Service
public class MallAddressServiceImpl extends ServiceImpl<MallAddressMapper, MallAddress> implements IMallAddressService {

    @Override
    public List<MallAddress> findAddress() {
        //获取用户信息
        SysUser userInfo = UserInfoInterceptor.getUserInfo();
        QueryWrapper<MallAddress> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("loc_member_id",userInfo.getUserId());
        return this.baseMapper.selectList(queryWrapper);
    }
}
